package com.shenhaofeng.app.adapter;

import java.util.HashMap;
import java.util.Map;


/**
 * Created by Administrator on 2016/7/22.
 */
public class Status {


    public static final int STATUS_MORE=1;
    public static final int STATUS_NOT_MORE=2;
    public static final int STATUS_MORE_LOADING=3;
    public static final int STATUS_MORE_ERROR=4;


    private Map<Integer, CharSequence> mMessageMap;

    private int mCurrentStatus = -1;
    private ModuleAdapter.Module<Status> mModule;





    public Status(ModuleAdapter.Module<Status> module) {
        this.mMessageMap = new HashMap<>();
        mModule =module;
    }





    public void put(int status, CharSequence message) {
        mMessageMap.put(status, message);
    }





    public void setCurrentStatus(int status) {
        mCurrentStatus = status;
        mModule.notifyItemChange(this);
    }





    public int getCurrentStatus() {
        return mCurrentStatus;
    }





    public CharSequence getCurrentMessage() {
        return mMessageMap.get(mCurrentStatus);
    }
}
